<template>
	<view class="container">
		<view class="title" v-if="isshow">
			{{data.name || ""}}
		</view>
		<view class="content ">
			<u-parse :tag-style="{p: 'margin-bottom:120upx;!important;'}"
				:content="data.content"></u-parse>
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/u-parse/u-parse.vue'
	import {
		getNewsInfo
	} from '@/api/index.js';
	export default {
		components: {
			uParse
		},
		data() {
			return {
				code: "",
				data: {},
				isshow:false
			}
		},
		onLoad(option) {
			console.log(option.code);
			this.code = option.code
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {
				uni.showLoading({
					title:'加载中···'
				})
				this.isshow=false
				getNewsInfo({
					data: {
						code: this.code
					}
				}).then(res => {
					if (res.code == 1) {
						console.log(res.data);
						this.data = res.data
						this.isshow=true
						uni.hideLoading()
					}
				})
			}

		}

	}
</script>
<style lang="scss" scoped>
	@import url("@/components/u-parse/u-parse.css");

	.container {
		background-color: #ffffff;
		min-height: 100vh;
		padding: 30upx;

		.title {
			text-align: center;
			font-size: 32upx;
			font-weight: 700;
			line-height: 120upx;
			border-bottom: 1px solid #000;
		}

		.content {
			font-size: 28upx;
			padding-top: 30upx;

		}
	}
	p{
		margin-bottom: 20px !important;
	}
	
	
	
</style>
